<!--
* description: 维修管理-回收网点查询
* author: hzm
* createdDate: 2021-4-28
-->
<template>
  <div class="app-container app-container-table">
    <one-table-template
      ref="multipleTable"
      :dynamic-buttons="tableButtons"
      :dynamic-components="tableComponents"
      :dynamic-api-config="dynamicApiConfigs"
      :dynamic-table-cols="tableCols"
      :dynamic-form-fields="formField"
      :dynamic-is-show-select="false"
      :dynamic-is-init-table="true"
      :dynamic-is-fix-choose="false"
      :dynamic-is-fix-index="false"
      :dynamic-api-style="'restful'"
    />
  </div>
</template>

<script>
// import { formMixins } from "@/components/mixins/formMixins";
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import OneTableTemplate from "@/components/templates/oneTable";
import { orgApis } from "@/api/caseManagementQuery";
import { exportExcel } from '@/utils/getTimeString.js'

export default {
  name: "recycleNodeQuery",
  components: {
    OneTableTemplate,
  },
  mixins: [oneTableWithViewTemplateMixins],
  data() {
    return {
      dynamicApiConfigs: orgApis.recoveryOutletsDelList,
      // 动态生成网格列
      tableCols:
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path] &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols
          .length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols
          : [
              {
                prop: "reclaimUnitName",
                label: "回收服务网点名称",
                align: "center",
              },
              {
                prop: "reclaimUnitCode",
                label: "回收服务网点统一社会信用代码",
                align: "center",
              },
              {
                prop: "unitAddress",
                label: "详细地址",
                align: "center",
              },
            ],
      tableComponents:
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path] &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
          .tableComponents &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
          .tableComponents.length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[this.$route.path]
              .tableComponents
          : [
              // 库存状态
              {
                compKey: "compKey1",
                labelName: "回收服务网点名称：",
                codeField: "reclaimUnitName",
                lookuptype: "VE0212",
                component: () => import("@/components/org/commonInput"),
                type: "inputText",
                isMust: true,
                span: 6,
              },
              // 车辆状态
              {
                compKey: "compKey2",
                labelName: "地址：",
                codeField: "unitAddress",
                component: () => import("@/components/org/commonInput"),
                type: "dropdownList",
                isMust: true,
                span: 6,
              }
            ],
      tableButtons: [
        {
          conmpKey: "btenKey1",
          type: "primary",
          size: "small",
          text: "查询",
          name: 'search',
          clickEvent: () => this.queryTable(1),
          position: "right",
        },
        {
          conmpKey: "btenKey2",
          type: "",
          size: "small",
          text: "重置",
          name: 'reset',
          clickEvent: () => this.reset(),
          position: "right",
        },
      ],
      formField: this.$utils.getFormField(this, {
        reclaimUnitName: "",
        unitAddress: ""
      }),
    };
  },
  methods: {
    export(){
      exportExcel(this.formField, orgApis.exportOutBoundStoreQuery.APIUrl, orgApis.exportOutBoundStoreQuery.ServiceCode, '出库单查询')
    },
  },
  mounted() {
    this.queryTable(1)
  },
};
</script>

<style>
</style>
